<?
// print_r($_POST);
// exit;
if(!$_SESSION['memberID'] || !isset($_POST['tids'])){print_r(json_encode(array('code'=>104)));exit;}
include("/var/www/html/new/com.inc.php");
// include("/var/www/html/new/conf/yd.le.je");
// include_once("/var/www/html/new/d/common/yd.le.je");
// $GLOBALS['le']=new yd_go_sql();
// $GLOBALS['le']->connect(); 
include("shoppingcart.class.php");
$ac=$GLOBALS['_ac'];
$pw=$GLOBALS['_pw'];
$s = new SoapClient(null,array("location" => "http://localhost/open/openService/pft_insideMX.php","uri" => "www.16u.com?ac_16u=$ac|pw_16u=$pw|auth_16u=true")); 
$sc=new shoppingcart($s,$_SESSION['memberID']);
$q = explode(',',$_POST['tids']);
foreach($q as $v){
    $sc->delete($v);
}
$fid = $_SESSION['memberID'];
$sql = "select count(*) as numlok from uu_shoppingcart where fid=$fid";
$GLOBALS['le']->query($sql);
$GLOBALS['le']->fetch_assoc();
$numlok = $GLOBALS['le']->f('numlok');
print_r(json_encode(array('code'=>200,'cartCount'=>$numlok)));

